package com.clstu.homeworks.homework07;

public class Teacher extends Person{
    private int workAge;

    public Teacher(String name, int age, String sex, int workAge) {
        super(name, age, sex);
        this.workAge = workAge;
    }

    public void teach(){
        System.out.println("我是老师，我承诺，我会好好教学");
    }

    @Override
    public String play() {
        return getName()+"爱下象棋";
    }

    @Override
    public void printInfo() {
        System.out.println("老师信息：");
        super.printInfo();
        System.out.println("工龄：    "+workAge);
    }
}
